﻿using System;
using System.Collections;

namespace StackText
{
    class Program
    {
        static void Main(string[] args)
        {
            Stack st = new Stack();
            st.Push("英语书");
            st.Push("数学书");
            st.Push("语文书");
            while (st.Count!=0)
            {
                Console.WriteLine("拿出"+st.Pop());
            }



            st.Push(1);
            st.Push(2);
            object[] obj = st.ToArray();
            foreach (var v in obj)
            {
                Console.WriteLine(v);
            }
            
            

            Console.WriteLine("获取" + st.Peek());
            
        }
    }
}
